Update EIP-7997: Add EAS-like bytecode + add required EIP#11856
Conversation
Remove nonce checks (EIP simplification)
|
✅ All reviewers have approved. |
| title: Deterministic Factory Contract | ||
| description: A minimal `CREATE2` factory shared by EVM chains. | ||
| author: Francisco Giordano (@frangio), Toni Wahrstätter (@nerolation), Nick Johnson (@Arachnid) | ||
| author: Francisco Giordano (@frangio), Toni Wahrstätter (@nerolation), Nick Johnson (@Arachnid), Jochem Brouwer (@jochem-brouwer) |
There was a problem hiding this comment.
Note: adding myself as author here, if this is too much will remove myself.
| category: Core | ||
| created: 2025-08-03 | ||
| requires: 1014 | ||
| requires: 161, 1014 |
There was a problem hiding this comment.
EIP-161 is implicitly required because of the hard-enforcement of setting nonce to 1 for the irregular state transition (or at least the result enforces that once the contract is deployed it has nonzero nonce). I assume this is because otherwise, if the nonce is not changed, it could deploy a contract with nonce 0, which would then be a new-ish kind of account which cannot be deployed anymore currently.
Note that prior to EIP-161 (Spurious Dragon) contracts deployed had nonce 0, and those which do not have CREATE/CALLCODE/DELEGATECALL opcodes are (currently) not possible to raise their nonce, so an account of type: "has code, nonce zero" currently exist on Mainnet.
I am actually not sure if we should impose "rules" in this EIP for the state transition. I would argue to simplify this EIP we leave out the irregular state transition in the specification. This EIP, once it is active, enforces that this specific address has this specific bytecode, and nothing more.
If a chain cannot deploy the factory by the keyless transaction and it did not have it in genesis, then this chain itself should come up with a way to add this factory (likely: via an irregular state transition).
There was a problem hiding this comment.
Removed this requirement, since this is not directly required by this EIP. The choice for nonce 1 could be considered "inspired" by it, but EIP-161 is definitely not a requirement for this EIP, as the nonce-related specs are self-contained in this EIP (we could also have choosen nonce "2", for instance)
eth-bot
left a comment
There was a problem hiding this comment.
All Reviewers Have Approved; Performing Automatic Merge...
This PR adds EAS-like bytecode treating the factory contract as a system contract, equivalent to existing system contract EIPs https://eips.ethereum.org/EIPS/eip-7002 and https://eips.ethereum.org/EIPS/eip-7251 (see "Bytecode")
Code taken from ethereum/sys-asm#51 after @fjl's comment on discord, thanks for that 😄 👍
Since we enforce the irreglar state transition to set the nonce from 0 to 1 in case the nonce of the account is (before transition) 0, which is a result of EIP-161 when created contracts started with nonce 1, not nonce 0.